package com.tbit.uqbike.object.pojo.vo;

import com.tbit.uqbike.annos.Excel;
import lombok.Data;

import java.util.Date;

/**
 * @author yao
 * @since 2025/1/23 10:08
 */
@Data
public class UpKeepLogRespVO {

    /**
     * 编号
     */
    private Integer id;
    /**
     * 区域编号
     */
    private Integer accountId;
    /**
     * 区域名称
     */
    @Excel(name = "区域名称", sort = 1)
    private String accountName;
    /**
     * 分区编号
     */
    private Integer regionId;
    /**
     * 分区名称
     */
    private String regionName;
    /**
     * 手机号
     */
    @Excel(name = "手机号", sort = 11)
    private String phone;
    /**
     * 用户名
     */
    @Excel(name = "运维人员名称", sort = 10)
    private String username;
    /**
     * 设备主键编号
     */
    private Integer machineId;
    /**
     * 车辆类型
     */
    private Integer machineType;
    /**
     * 用户编号
     */
    @Excel(name = "车辆编号", sort = 2)
    private String userCode;
    /**
     * 设备编号
     */
    @Excel(name = "设备编号", sort = 3)
    private String machineNo;
    /**
     * 保养类型
     */
    @Excel(name = "保养类型", sort = 9, readConverterExp = "0=车辆清洗,1=车灯检修,2=头盔检修,3=刹车检修,4=喇叭检修,5=链条检修,6=轮胎检修,7=电机检修,8=电池检修,9=中空检修,10=其他")
    private String upKeepTypes;
    /**
     * 状态（0：无效，1：有效）
     */
    @Excel(name = "审核状态", sort = 12, readConverterExp = "0=无效,1=有效")
    private Integer status;
    /**
     * 图片地址
     */
    private String url;
    /**
     * 骑行里程
     */
    @Excel(name = "骑行里程", sort = 7)
    private Integer mileage;
    /**
     * 投放时间
     */
    @Excel(name = "投放时间", sort = 6)
    private Integer time;
    /**
     * 总骑行里程
     */
    @Excel(name = "总骑行里程", sort = 5)
    private Integer totalMileage;
    /**
     * 总投放时间
     */
    @Excel(name = "总投放时间", sort = 4)
    private Integer totalTime;
    /**
     * 备注
     */
    @Excel(name = "备注", sort = 13)
    private String remark;
    /**
     * 创建者
     */
    private String creator;
    /**
     * 创建时间
     */
    @Excel(name = "保养时间", dateFormat = "yyy-MM-dd HH:mm:ss", sort = 8)
    private Date createTime;
    /**
     * 更新者
     */
    private String updater;
    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 数量
     */
    private Integer count;

    /**
     * 日期
     */
    private String date;

    /**
     * 有效数量
     */
    private Integer validCount;

    /**
     * 无效数量
     */
    private Integer invalidCount;

    public static UpKeepLogRespVO of(String date) {
        UpKeepLogRespVO upKeepLogRespVO = new UpKeepLogRespVO();
        upKeepLogRespVO.setDate(date);
        upKeepLogRespVO.setCount(0);
        return upKeepLogRespVO;
    }
    /**
     * M转KM
     */
    public void MConvertKM() {
        mileage = mileage == null ? 0 : mileage / 1000;
        totalMileage = totalMileage == null ? 0 : totalMileage / 1000;
    }

}
